/**
 * @brief Calculator Version 1, Basic calcultor for add and sub
 * @date 2021-06-27 13:53:57
 * @author fujie
*/

#include <stdio.h>

int main()
{
    int adderA = 0, adderB = 0, result = 0;
    char symbol;
    printf("input adder A: ");
    scanf("%d", &adderA);
    printf("input adder B: ");
    scanf("%d", &adderB);

    printf("input symbol: ");
    getchar(); // get the \n before get char symbol
    symbol = getchar(); // input a char variable

    if (symbol == '+')
        result = adderA + adderB;
    else if (symbol == '-')
        result = adderA - adderB;

    printf("%d %c %d = %d\n", adderA, symbol, adderB, result);
    return 0;
}